<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"
	import = "ass.beans.*"
	import = "ass.dao.*"
	import = "ass.dao.support.*"
	import = "java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edit Privacy</title>
</head>

<% 
String username = (String) session.getAttribute("username");

UserPrivacyDAO userPrivacyDAO= new UserPrivacyDAOImpl();
UserPrivacyBean userPrivacy = userPrivacyDAO.getUser(username);

if (userPrivacy == null){
	userPrivacy = new UserPrivacyBean();
	
}

%>

<body>
	<%@ include file="header.html"%>
	<%@ include file="userNavBar.html"%>

	<div align="center">

	<%= (String) request.getAttribute("updated") == null ? "":(String) request.getAttribute("updated") %>
	
		<form name="form1" method="post" action="EditPrivacy">
			<table width="400" border="0">
			<tr>
					<td align="left">Username:</td>
				    <td> <%=username%> <br> <br></td>
				</tr>
            <tr>
            <td width="254">&nbsp;</td>
            <td width="136">View by Public</td></tr>
				
				<tr>
					<td align="left">First name:</td> 
					<td><input type="checkbox" name="checkbox2" <%= userPrivacy.isFirstNameShared()?"checked" : ""  %> id="checkbox2" value="true2">
					</td>
				</tr>
				<tr>
					<td align="left">Last name:</td>
					<td><input type="checkbox" name="checkbox3"  <%= userPrivacy.isLastNameShared()?"checked" : ""  %> id="checkbox3"  value="true3"></td>
				</tr>
				<tr>
					<td align="left">Year of birth:</td>
					<td><input type="checkbox" name="checkbox4" <%= userPrivacy.isYearOfBirthShared()?"checked" : ""  %> id="checkbox4" value="true3">
						</td>
				</tr>
				<tr>
					<td align="left">Email:</td>
					<td><input type="checkbox" name="checkbox5" <%= userPrivacy.isEmailShared()?"checked" : ""  %> id="checkbox5" value="true3"></td>
				</tr>
				<tr>
					<td align="left">Favorite Actors and Actress:</td>
					<td><input type="checkbox" name="checkbox6" <%= userPrivacy.isFavActorShared()?"checked" : ""  %> id="checkbox6" value="true3"></td>
				</tr>
				<tr>
					<td align="left">Favorite Genre:</td>
					<td><input type="checkbox" name="checkbox7" <%= userPrivacy.isFavGenreShared()?"checked" : ""  %> id="checkbox7" value="true3"></td>
				</tr>
				
				<tr>
					<td><input type="submit" name="submit" id="submit"
						value="Submit"></td>
					<td align="left"></td>
				</tr>
			</table>
		</form>
	</div>

</body>
</html>